//
//  CellForDestination.m
//  ProjectA
//
//  Created by dllo on 16/3/7.
//  Copyright © 2016年 刘旺辉. All rights reserved.
//

#import "CellForDestination.h"
#import "AppMacro.h"
@interface CellForDestination ()
@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel *label;
@end

@implementation CellForDestination
- (void)dealloc {
    
    [_imageView release];
    [_label release];
    [super dealloc];
}
- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.imageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.imageView];
        [_imageView release];
        
        self.label = [[UILabel alloc] init];
        [self.contentView addSubview:self.label];
        [_label release];
    }
    return self;
}
- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.imageView.frame = CGRectMake(20, 10, self.bounds.size.width - 40, self.bounds.size.height - 40);
    
    
    self.label.frame = CGRectMake(15, 10 + self.bounds.size.height - 40, self.bounds.size.width - 30, self.bounds.size.height - 10 - self.imageView.frame.size.height - 5);
    self.label.font = [UIFont systemFontOfSize:10];
    self.label.textAlignment = 1;
    
    [UIView setColorWithLabelText:self.label nightColor:L_COLOR_WHITE dayColor:L_COLOR_BLACK];
}
- (void)passData:(NSString *)image item:(NSInteger)item {
    self.imageView.image = [UIImage imageNamed:image];
    switch (item) {
        case 0: {
            
            self.label.text = @"不可错过";
            break;
        }
        case 1: {
            self.label.text = @"旅行地点";
            break;
        }
        case 2: {
            self.label.text = @"主题榜单";
            break;
        }
        case 3: {
            self.label.text = @"精彩原创";
            break;
        }
        case 4: {
            self.label.text = @"实用须知";
            break;
        }
       
    }
}
@end
